package com.cherrish.demo.proxy;

/**
 * @author ccl
 * @time 2019-01-22 10:15
 * @name Test
 * @desc:
 */
public class Test {
    public static void main(String[] args) {
        IUserDao proxy = new UserDaoProxy();
        proxy.find();
        proxy.save();

        System.out.println("------------------------------------");

        IUserDao target = new UserDao();
        System.out.println("目标对象：" + target.getClass());

        IUserDao pxy = (IUserDao) new ProxyFactory(target).getProxyInstance();
        System.out.println("代理对象：" + pxy.getClass());
        pxy.save();
    }
}
